// Copyright (c) 2022, hzmes and contributors
// For license information, please see license.txt

frappe.ui.form.on('SRM Supply Plan', {
	refresh: function(frm) {
		frm.add_custom_button(__('分发供应商'), () => {
			frm.call({
				method: "distribute",
				doc: frm.doc,
				args: {},
				freeze: true,
				freeze_message: __("running..."),
				callback: function(r) {
					frappe.show_alert({
						message:__('分发成功!'),
						indicator:'green'
					}, 5);;
				}
			})
		})
	}
});
